# Maintainer: Alexey Pavlov <alexpux@gmail.com>

pkgname=bison
pkgver=3.7.6
pkgrel=1
pkgdesc="The GNU general-purpose parser generator"
arch=('i686' 'x86_64')
license=('GPL3')
url="https://www.gnu.org/software/bison/bison.html"
depends=('m4' 'sh')
groups=('base-devel')
options=('staticlibs')
makedepends=('flex')
install=bison.install
source=(https://ftp.gnu.org/gnu/bison/${pkgname}-${pkgver}.tar.xz{,.sig}
        bison-3.1-msys2.patch)
sha256sums=('67d68ce1e22192050525643fc0a7a22297576682bef6a5c51446903f5aeef3cf'
            'SKIP'
            '3c4253ba6088bed5581617142a3bb4497ff20e28831c57adba46fc8028fd989c')
validpgpkeys=('7DF84374B1EE1F9764BBE25D0DDCAA3278D5264E')  # Akim Demaille


prepare() {
  cd ${srcdir}/${pkgname}-${pkgver}
  patch -p1 -i ${srcdir}/bison-3.1-msys2.patch

  autoreconf -vfi
}

build() {
  cd ${srcdir}/${pkgname}-${pkgver}
  ./configure --prefix=/usr
  make
}

check() {
  cd ${srcdir}/${pkgname}-${pkgver}
  make check
}

package() {
  cd ${srcdir}/${pkgname}-${pkgver}
  make DESTDIR=${pkgdir} install
}
